﻿@model XPressify.Models.PostponedListModel
@using XPressify.Data.Helpers

@{
    ViewBag.Title = "Blocked list";
}

<table>
    <tr>
        <th style="width:300px">
            Name
        </th>
        <th>
            Type
        </th>
        <th></th>
    </tr>

@foreach (var item in Model.Users)
{
    <tr>
        <td>
            @if (item.BaseSubjectType == SubjectType.User)
            {
                @Html.ActionLink(item.Name, "ProfileView", "Profile", new { id = item.Id }, new { @class = "nobtn" , style="color:blue" })
            }
            else if (item.BaseSubjectType == SubjectType.Event)
            {
                @Html.ActionLink(item.Name, "EventDetails", "Event", new { id = item.Id }, new { @class = "nobtn", style = "color:blue" })
            }
            else if (item.BaseSubjectType == SubjectType.Group)
            {
                @Html.ActionLink(item.Name, "GroupDetails", "Group", new { id = item.Id }, new { @class = "nobtn" , style="color:blue"})
            }
            else if (item.BaseSubjectType == SubjectType.Page)
            {
                @Html.ActionLink(item.Name, "PageDetails", "Page", new { id = item.Id }, new { @class = "nobtn" , style="color:blue"})
            }
        </td>
        <td>
            @if (item.RelationshipType != RelationshipType.AdministratorOf)
            {
                @item.Type  
            }
            else
            {
                @:become administrator
            }
        </td>
        <td style="text-align:right">
            @Html.ActionLink("Unblock", "DeleteRelationship", "Profile", new { id = item.RelationshipId }, new { })
        </td>
    </tr>
}

</table>